<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./vue.js"></script>
  <div id="app">
    <!-- prevent阻止跳转事件，事件修饰符 -->
    <a href="http://www.baidu.com" @click.prevent='show'>点击跳转</a>
    <div  @click='div' style="height: 100px;  background-color: pink;">
      <!-- stop阻止冒泡事件 -->
      <button @click.stop="btn" style="margin: 30px;">按钮</button>
    </div>
  </div>
  <script>
  const vm = new Vue({
    el:'#app',
    data:{
      tips:'123',

    },
    methods:{
      show() {
        console.log('a被点击了!!!');
      },
      div() {
        console.log('我是div');
      },
      btn() {
        console.log('我是btn');
      }
    }
  })
  </script>
</body>
</html>